// mircoApp/new-auction/account_management/account_management.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    btn: [{
        icon: "iconfont icon-chongzhimingxi",
        txt: "充值",
        link: "/mircoApp/new-auction/new_auction_recharge/new_auction_recharge"
      },
      {
        icon: "iconfont icon-tixian3",
        txt: "提现",
        link: "/mircoApp/new-auction/new_auction_withdraw/new_auction_withdraw?tag=balance"
      },
      {
        icon: "iconfont icon-zhangdanmingxi",
        txt: "账单明细",
        link: "/mircoApp/new-auction/new_auction_billing/new_auction_billing?tag=new_auction_billing"
      },
      {
        icon: "iconfont icon-chongzhimingxi",
        txt: "充值明细",
        link: "/mircoApp/new-auction/new_auction_billing/new_auction_billing?tag=new_auction_rechargeDetail"
      },
      {
        icon: "iconfont icon-canpaimingxi",
        txt: "参拍明细",
        link: "/mircoApp/new-auction/new_auction_Bidding_detail/new_auction_Bidding_detail?tag=new_auction_Bidding_detail"
      },
      {
        icon: "iconfont icon-weipaimingxi",
        txt: "委拍明细",
        link: "/mircoApp/new-auction/new_auction_Bidding_detail/new_auction_Bidding_detail?tag=new_auction_Auction_details"
      },
      {
        icon: "iconfont icon-shouyimingxi",
        txt: "收益明细",
        link: "/mircoApp/new-auction/new_auction_Income_detail/new_auction_Income_detail?tag=new_auction_Income_detail"
      },
      {
        icon: "iconfont icon-yinglimingxi",
        txt: "盈利明细",
        link: "/mircoApp/new-auction/new_auction_Income_detail/new_auction_Income_detail?tag=new_auction_Profit_detail"
      }
    ],
    infoData: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let language = wx.getStorageSync("langIndex");
    this.setData({
      language: language.en
    })
  },
  toUrlLink(e) {
    let {
      item
    } = e.currentTarget.dataset;
    wx.navigateTo({
      url: item.link,
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    this.getData();
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  },
  async getData() {
    let {
      data
    } = await app._postNetWork({
      url: app.getNetAddresss("plugin.new-auction.frontend.index")
    })
    if (data.result) {
      this.setData({
        infoData: data.data
      })
    } else {
      app.tips(data.msg)
    }
  },
})